package com.recsmile.sgs.client.util;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

import com.recsmile.sgs.client.commonds.GameClientCommand;
import com.recsmile.sgs.client.entity.Hero;

public class SyncCommandsUtil {

	private SyncCommandsUtil() {}
	
	public static Map<String, GameClientCommand<? extends Hero>> generateMapForSameCommand(
		String name, 
		Set<String> otherNames, 
		GameClientCommand<? extends Hero> command) {
		Map<String, GameClientCommand<? extends Hero>> map = new HashMap<String, GameClientCommand<? extends Hero>>();
		for (String n : otherNames) {
			map.put(n, command);
		}
		map.put(name, command);
		return map;
	}
	
	public static Map<String, GameClientCommand<? extends Hero>> generateMapForDifferentCommand(
		String name, 
		Set<String> otherNames, 
		GameClientCommand<? extends Hero> selfCommand,
		GameClientCommand<? extends Hero> othersCommand) {
		Map<String, GameClientCommand<? extends Hero>> map = new HashMap<String, GameClientCommand<? extends Hero>>();
		for (String n : otherNames) {
			map.put(n, othersCommand);
		}
		map.put(name, selfCommand);
		return map;
	}
	
}
